import request from '@/api/config/request'
import { ApiResponse } from '@/api/type'

interface IUserLoginData {
  username: string,
  password: string
}

interface ILoginResponseData  {
  token: string
}

export const login = (data: IUserLoginData): Promise<ApiResponse<ILoginResponseData>> => {
  return request.post('/auth/login', data)
}
